package com.bdqn.thread;


import com.bdqn.component.BlogConstants;
import com.bdqn.util.FileUtil;

import javax.servlet.http.HttpSession;
import java.util.List;

/**
 * 删除文件的线程类
 */
public class FileDeleteThread extends  Thread {

    private List<String> fileNameList;
    private HttpSession session;
    public FileDeleteThread(List<String> fileNameList, HttpSession session){
        this.fileNameList=fileNameList;
        this.session=session;
    }
    @Override
    public void run() {
      if (fileNameList != null && fileNameList.size()>0){
          for (String fileName : fileNameList){
              System.out.println("----删除了文件"+fileName);
              FileUtil.deleteFile(session,fileName, BlogConstants.ARTICLE_SAVE_PATH);
          }
      }
    }

}
